package com.whatisjee.ssf.domain.service;

import java.util.List;

import com.whatisjee.ssf.domain.entity.Log;
import com.whatisjee.ssf.domain.entity.Role;
import com.whatisjee.ssf.domain.entity.User;
import com.whatisjee.ssf.exception.BusinessException;
import com.whatisjee.ssf.exception.NoRollbackBusinessException;
import com.whatisjee.ssf.misc.LogCriteria;
import com.whatisjee.ssf.misc.Page;
import com.whatisjee.ssf.misc.PagingList;
import com.whatisjee.ssf.misc.UserCriteria;
import javax.ejb.Local;

@Local
public interface AppService {
	public List<String> findDistincts(String entityName, String propName);
	
	public User saveUser(User user) throws BusinessException;
	public PagingList<User> findUsers(UserCriteria criteria, Page page);
	public User authenticate(String name, String password) throws NoRollbackBusinessException;
	public List<Role> findRoles();
	public User findUser(Integer id);
	
	public Log log(Short severity, String summary, String detail, Object... args);
	public Log log(User user, Short severity, String summary, String detail, Object... args);
	public PagingList<Log> findLogs(LogCriteria criteria, Page page);
}
